/*
 * can_driver.h
 *
 *  Created on: 2023��4��11��
 *      Author: chenwangang
 */

#ifndef BSP_BSP_CAN_CAN_DRIVER_H_
#define BSP_BSP_CAN_CAN_DRIVER_H_


/* SDK includes. */
#include "Cpu.h"
#include "bsp_can_cfg.h"
#include "user_define.h"

#define RX_CAN_FIFO ('r') /*Rx can fifo number*/
#define DLEN_ID_LEN	8u	/* DLEN_ID_LEN include rx_data_len len add rx_data_id len */


typedef struct
{
    uint32_t rx_data_len;      /*RX can harware data len*/
    uint32_t rx_data_id;      /*RX data ID*/
    uint8_t rx_data_buf[64u];   /*RX data buf*/
} t_rx_can_msg;



#if(CAN_USED)
/*init can */
extern void Bsp_CAN_Init(void);
/*transmitted can message callback*/
extern void transmit_can_msg_callback(void);



extern QueueHandle_t g_normal_tx_can_msg_queue;

extern can_message_t canRecvMsg;
extern can_message_t canRecvMsg2;
extern can_message_t canRecvMsg3;
extern can_message_t canRecvMsg4;
extern can_message_t canSendMsg;

#endif


#endif /* BSP_BSP_CAN_CAN_DRIVER_H_ */
